package com.guava;

import com.google.common.base.Preconditions;

/**
 * @author: sun.hongliang
 * @create: 2018/06/12 17:08
 */
public class PreconditionsTest {
    public static void main(String[] args) {
        testPreconditions4();
    }

    public static void testPreconditions1() {
        Preconditions.checkArgument(false, "参数错误");
    }

    public static void testPreconditions2() {
        Preconditions.checkArgument(false, "参数【%s】错误", null);
    }

    public static void testPreconditions3() {
        Preconditions.checkNotNull(null, "param is null");
    }

    public static void testPreconditions4() {
        Preconditions.checkNotNull(null, "param [%s] is null", 1);
    }
}
